﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using System;
using Umi.Web.Metadatas.Attributes;
using Umi.Web.Metadatas.Configurations;

namespace Umi.Web.Service.DependencyInject
{
    [Startup]
    public class StartupInject
    {

        public void ConfigureService(IServiceCollection services, IConfiguration configuration)
        {
            services.AddHttpClient("httpClient", config =>
            {
                config.Timeout = TimeSpan.FromSeconds(10D);
                config.DefaultRequestHeaders.Add("UserAgent", "Umi Web Api");
            });

            services.Configure<EmailSmtpServerConfiguration>(configuration.GetSection("SmtpServer"));
        }
    }
}
